package br.edu.unifei.cct720.trabalho08.modelo.ponto;

import java.awt.Color;
import java.awt.Graphics;

public class Ponto2D {
	
	// Declaracao de variaveis de instancia
	private int x;
	private int y;
	private Color cor;

	/**
	 * Construtor
	 * 
	 * @param x
	 * @param y
	 */
	public Ponto2D(int x, int y) {
		this(x, y, Color.BLACK);
	}

	/**
	 * Construtor
	 * 
	 * @param x
	 * @param y
	 */
	public Ponto2D(double x, double y) {
		this(x, y, Color.BLACK);
	}
	
	/**
	 * Construtor 
	 * 
	 * @param x
	 * @param y
	 * @param cor
	 */
	public Ponto2D(int x, int y, Color cor) {
		this.x = x;
		this.y = y;
		this.cor = cor;
	}

	/**
	 * Construtor
	 * 
	 * @param x
	 * @param y
	 * @param cor
	 */
	public Ponto2D(double x, double y, Color cor) {
		this(new Double(x).intValue(), new Double(y).intValue(), cor);
	}


	public void plota(Graphics g) {
		g.setColor(cor);
		g.drawLine(x, y, x, y);
	}

	// Metodos getters e setters
	public int getX() {
		return x;
	}

	public void setX(int x) {
		this.x = x;
	}

	public int getY() {
		return y;
	}

	public void setY(int y) {
		this.y = y;
	}

	public Color getCor() {
		return cor;
	}

	public void setCor(Color cor) {
		this.cor = cor;
	}	
}
